<template>
    <div class="body_background" :style="GetWindowBackground">
        <div class="body_background padding-top10">
            <div class="block-box">
                <div class="title-box">
                    <div class="big-font-size three-color">基础信息</div>
                </div>
                <ul class="create-box">
                    <li>
                        <div class="big-font-size main-color white-space">商品图片：</div>
                        <img src="../../assets/img/personal.png">
                    </li>
                    <li>
                        <div class="big-font-size main-color white-space">商品名称：</div>
                        <div class="three-color">刘啊丹</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color white-space">商品分类：</div>
                        <div class="three-color">卤味</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color white-space">商品类型：</div>
                        <div class="three-color">总部直供</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color white-space">商品平均进价：</div>
                        <div class="price-color">￥200</div>
                    </li>
                </ul>
            </div>
            <div class="block-box items-start">
                <div class="big-font-size three-color">规格信息</div>
                <ul class="create-box">
                    <li>
                        <div class="big-font-size main-color white-space">商品规格：</div>
                        <div class="three-color">200g</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color white-space">商品袋规：</div>
                        <div class="three-color">2个</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color white-space">商品箱规：</div>
                        <div class="three-color">20袋</div>
                    </li>
                </ul>
            </div>
            <div class="block-box items-start mar" v-if="goodsType==1">
                <div class="big-font-size three-color">仓储信息</div>
                <ul class="create-box">
                    <li>
                        <div class="big-font-size main-color white-space">发货仓库：</div>
                        <div class="three-color">天津仓库</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color white-space">存储方式：</div>
                        <div class="three-color">冷冻仓</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color white-space">库 存 量：</div>
                        <div class="three-color">20袋</div>
                    </li>
                </ul>
            </div>
            <div class="block-box items-start mar" v-else>
                <div class="big-font-size three-color">仓储信息</div>
                <ul class="create-box">
                    <li class="flex-start">
                        <div class="big-font-size main-color white-space">关联供应商：</div>
                        <div class="three-color">
                            <div class="three-color flex">专供总店供应商
                                <div class="default">默认</div>
                            </div>
                            <div class="three-color">XXX供应商</div>
                            <div class="three-color green-color"
                                 @click="configShupplierFun"
                            >设置供应商
                            </div>
                        </div>
                    </li>
                    <li>
                        <div class="big-font-size main-color white-space">存&nbsp;储&nbsp;方&nbsp;式：</div>
                        <div class="three-color">冷冻仓</div>
                    </li>
                    <li>
                        <div class="big-font-size main-color white-space">
                            库&nbsp;&nbsp;&nbsp;存&nbsp;&nbsp;&nbsp;量&nbsp;：
                        </div>
                        <div class="three-color">20袋</div>
                    </li>
                </ul>
            </div>


            <div class="button-box body_background">
                <mt-button class="width40 middle-font-size"
                           @click="cancelFun"
                >取消
                </mt-button>
                <mt-button class="width40 middle-font-size background white-color"
                           @click="lossReportFun"
                >报损
                </mt-button>
            </div>
        </div>
    </div>
</template>

<script>

    export default {
        name: "StockGoodsDetail",
        data() {
            return {
                id: '',
                GetWindowBackground: {
                    'min-height': ''
                },
                goodsType: 2,//1:总部直供  2：门店自采
            }
        },
        mounted() {
            this.id = this.$route.query.id;
            console.log(this.id)
        },
        methods: {
            //设置供应商
            configShupplierFun() {
                this.$router.push('/ConfigSupplier')
            },
            //移除
            cancelFun(item) {
                // this.$router.push('/StaffManage')
            },
            //报损
            lossReportFun(item) {
                this.$router.push('/StockLossReportSub')
            },
            getBodyHeight() {
                // 获取浏览器高度，减去顶部搜索栏和导航栏的值 55 + 50（可动态获取）,再减去底部高度值60
                this.GetWindowBackground['min-height'] = window.innerHeight + 'px'
            },
        },
        // 生命周期 - 创建完成（可以访问当前this实例）
        created() {
            window.addEventListener('resize', this.getBodyHeight) // 注册监听器
            this.getBodyHeight() // 页面创建时先调用一次
        },
        // 生命周期 - 销毁完成
        destroyed() {
            window.removeEventListener('resize', this.getBodyHeight)
        },
    }
</script>

<style lang="scss" scoped>

    .padding-top10 {
        padding-top: 15px;
    }

    .block-box {
        width: calc(100% - 60px);
        padding: 20px 20px 0 20px;
        border-radius: 8px;
        margin-bottom: 15px;
    }

    .title-box {
        width: 100%;
        display: flex;
        justify-content: space-between;
    }

    .create-box {
        width: 100%;
        padding-bottom: 10px;
        padding-top: 10px;
        li {
            width: 100%;
            display: flex;
            padding: 5px 0;
            align-items: center;
            img {
                width: 80px;
                height: 80px;
                border-radius: 8px;
            }
            div {
                margin-bottom: 7px;
            }
            .three-color {
                width: calc(100% - 100px);
                text-align: left;
            }
            input {
                width: calc(100% - 100px);
                height: 30px;
                border-top: 0;
                border-left: 0;
                border-right: 0;
                border-bottom: 1px solid #ebedf1;
                outline: none;
                list-style: none;
            }
        }
        .flex-start {
            align-items: flex-start !important;
        }
    }

    .note-content {
        width: calc(100% - 20px);
        border-radius: 6px;
        border: 1px solid #eef0f3;
        margin: 8px 0 25px 0;
        text-align: left;
        font-size: 13px;
        padding: 10px;
        outline: none;
        list-style: none;
    }

    .button-box {
        width: calc(100% - 20px);
        height: 50px;
        display: flex;
        justify-content: space-around;
        align-items: center;
        position: fixed;
        bottom: 0px;
        border: 10px solid #f5f6fa;
        .width40 {
            width: 40%;
            border: 1px solid #05c569;
            color: #05c569;
            border-radius: 10px;
        }
    }

    .mar {
        margin-bottom: 80px;
    }


    .default {
        width: 34px;
        height: 15px;
        background: #6678ff;
        position: relative;
        font-size: 12px;
        text-align: center;
        color: #e9f9fb;
        border-radius: 4px 4px 0 0;
        margin-left: 5px;
    }

    .default:after {
        content: "";
        position: absolute;
        bottom: -3px;
        left: 0;
        width: 0;
        height: 0;
        border-left: 17px solid transparent;
        border-right: 17px solid transparent;
        border-top: 3px solid #6678ff;
    }

    .warehoue {
        width: 100% !important;
        display: flex;
    }


</style>